﻿<UserControl x:Class="myChannel9.Control_Search"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="White">

    <UserControl.Resources>
        <Style x:Key="PanoramaTextBlock" TargetType="TextBlock">
            <Setter Property="Foreground" Value="#FF404040"/>
            <Setter Property="FontSize" Value="30"/>
        </Style>

        <Style x:Key="PanoramaTextListBox" TargetType="ListBox">
            <Setter Property="ItemContainerStyle">
                <Setter.Value>
                    <Style TargetType="ListBoxItem">
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="ListBoxItem">
                                    <TextBlock Text="{Binding Name}"
                                               Style="{StaticResource PanoramaTextBlock}"/>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                    </Style>
                </Setter.Value>
            </Setter>
        </Style>
    </UserControl.Resources>

    <Grid>
        <StackPanel Orientation="Horizontal" VerticalAlignment="Top" Margin="-12,-12">
            <TextBox x:Name="txtSearch" Width="330" Height="80" FontSize="30" Background="White" />
            <Button Height="80" BorderBrush="White"  >
                <Image x:Name="btnSearch" Source="Images/appbar_search.png" Width="44" Height="48" MouseLeftButtonDown="btnSearch_MouseLeftButtonDown" />
            </Button>
        </StackPanel>

        <ListBox x:Name="lboSearch" Margin="0,80,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Width="400" SelectionChanged="lboSearch_SelectionChanged">
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <!--<Grid>
                        <Border Background="White" Margin="0,0,0,30" Width="400" Opacity="0.5" />
                        <StackPanel Orientation="Vertical">
                            <TextBlock Text="{ Binding PostedDetails}" TextWrapping="Wrap" Margin="20,0,25,20" Style="{StaticResource PanoramaTextBlock}" />
                            <TextBlock Text="{ Binding Heading}" TextWrapping="Wrap" Margin="20,0,25,40" Style="{StaticResource PanoramaTextBlock}" />
                        </StackPanel>
                    </Grid>-->
                    <Grid>
                        <Border Background="White" Margin="0,0,0,30" Width="400" Opacity="0.5" />
                        <StackPanel Orientation="Vertical">
                            <StackPanel Orientation="Horizontal" Margin="0,0,20,0">
                                <Image Source="{ Binding getImage }" Width="200" Margin="0,0,10,10" VerticalAlignment="Top" HorizontalAlignment="Left" />
                                <StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Center" >
                                    <TextBlock Text="{ Binding getPostedDetails}" FontSize="26" Margin="5,0,0,0" TextWrapping="Wrap" Style="{StaticResource PanoramaTextBlock}" />
                                    <TextBlock Text="{ Binding getLenght}" FontSize="26" Margin="5,0,0,0" TextWrapping="Wrap" Style="{StaticResource PanoramaTextBlock}" />
                                </StackPanel>
                            </StackPanel>
                            <TextBlock Text="{ Binding Heading}" TextWrapping="Wrap" Margin="20,0,25,40" Style="{StaticResource PanoramaTextBlock}" />
                        </StackPanel>
                    </Grid>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>

        <Grid x:Name="gridSearchHelp" Margin="0,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Center" >
            <Grid Background="White" Opacity="0.6" Width="225" Height="70" />
            <TextBlock Foreground="#FF404040" FontSize="26" Width="200" Text="search in already browsed content" TextWrapping="Wrap" TextAlignment="Center" VerticalAlignment="Center" HorizontalAlignment="Center" />
        </Grid>
        
    </Grid>
</UserControl>
